package com.retallife.admin.service.Admin.Impl;


import com.retallife.admin.dao.Admin.AdminMapper;
import com.retallife.admin.pojo.Business.BusinessVo;
import com.retallife.admin.pojo.User.UserAddVo;
import com.retallife.admin.pojo.User.UserNameVo;
import com.retallife.admin.pojo.User.UserVo;
import com.retallife.admin.pojo.admin.adminVo;
import com.retallife.admin.service.Admin.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    AdminMapper adminMapper;

    /**
     * 查询Admin表中的所有的数据
     * @return 查询的数据
     */
    public List<adminVo> adminFindAllAdmin() {
        return adminMapper.adminFindAllAdmin();
    }

    /**
     * 查询business表中的所有的数据
     * @return 查询的数据
     */
    public List<BusinessVo> adminFindAllBusiness() {
        return adminMapper.adminFindAllBusiness();
    }

    /**
     * 查询user表单里面的数据
     * @return 查询的数据结果
     */
    public List<UserVo> adminFindAllUser() {
        return adminMapper.adminFindAllUser();
    }

    public List<UserNameVo> adminFoundUser(UserNameVo userNameVo) {
        return adminMapper.adminFoundUser(userNameVo);
    }

    public int adminAddUser(UserAddVo userAddVo) {
        return adminMapper.adminAddUser(userAddVo);
    }

    public int adminDeleteUser(UserNameVo userNameVo) {
        return adminMapper.adminDeleteUser(userNameVo);
    }

    public int adminUpdateUser(UserVo userVo) {
        return adminMapper.adminUpdateUser(userVo);
    }
}
